package com.example.demo.impl;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.example.demo.bean.Result;
import com.example.demo.common.Constent;
import com.example.demo.exception.SPIPException;
import com.example.demo.intf.FileInterface;
import com.example.demo.util.FileUtil;

/**
 * @author 88377761
 *
 */
@RestController
public class FileImpl implements FileInterface {

	@Override
	public Result upload(String type, String id, MultipartFile file) throws SPIPException {
		if (file != null && !file.isEmpty()) {
			FileUtil.upload(file, Constent.getFileUpUrl(type, id));
		}
		return Result.getOk();
	}


}
